<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // map()方法
        // 返回一个新数组，数组中的元素为原始数组元素调用函数处理后的值

        let arr = [1,3,5,7,9];
        let arr2 = arr.map((item,index) => {
            return item * 2;
        });
        console.log(arr2);
        // 结果： [2, 6, 10, 14, 18]
    </script>
</body>
</html>